package com.lzx.article.controller.web;


import com.lzx.article.entity.Collect;
import com.lzx.article.service.CollectService;
import com.lzx.common.utils.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/article/collect/web")
public class WebCollectController {
    @Resource
    private CollectService collectService;

    //查询当前用户的收藏记录
    @GetMapping("/getUserCollectList/{userId}")
    public R getUserCollectList(@PathVariable int userId) {
        return collectService.getUserCollectList(userId);
    }

    //收藏功能
    @PostMapping("/saveUserCollect")
    public R saveUserCollect(@RequestBody Collect collect) {
        return collectService.saveUserCollect(collect);
    }
}
